import {useLocation} from 'react-use';
import React from 'react';

const Demo = () => {
  // 定位到当前url的位置
  const state = useLocation();
  const props = state.href;

  return (
    <div>
        <pre>{JSON.stringify(state, null, 2)}</pre>
        <span>{props}</span>
    </div>
  );
};

export default Demo;